Syncs submodules after remote update (closes #370)
authorTim Carey-Smith <tim@spork.in>
Fri, 15 Aug 2014 22:12:14 +0000 (15:12 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 Aug 2014 16:10:15 +0000 (09:10 -0700)
commit2c12269e20a1ef8820012011c7cde395c488acd3
tree60f324bceccc2a9e5c5bf5c3b6a2dff38d8f4333
parentc9e086313772c8a1974215911f35fee6dd9ab528
Syncs submodules after remote update (closes #370)

Previously, the Git code avoided cloning a local copy of the local
database for a repository if the repo already existed (and instead tried
to fetch). However, fetching does not sync and reinitialize submodules,
which would require more work.

To avoid this problem, and possibly other subtle updating issues in the
future, the code now wipes the local clone whenever it detects that the
HEAD of a particular branch has changed. This avoids subtle
inconsistencies between fresh clones and updates.

Note: This only affects local-to-local clones. It does not initiate any
new network activity. It may require some additional disk usage, but
only when a remote fetch that was already happening discovers new
commits on the checked-out branch.
src/cargo/sources/git/utils.rs
tests/test_cargo_compile_git_deps.rs